<template>
  <BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="closeModal">
    <template #footer>
      <a-button type="primary" @click="closeModal">关闭</a-button>
    </template>
    <div class="w-200px mx-auto">
      <QrCode :value="qrCodeUrl" />
    </div>
  </BasicModal>
</template>

<script lang="ts">
  import { defineComponent, ref } from 'vue';
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import { QrCode } from '/@/components/Qrcode/index';
  //import { getQrCode } from '/@/api/demo/system';

  const qrCodeUrl = ref('');

  export default defineComponent({
    components: { BasicModal, QrCode },
    setup() {
      const getTitle = '验证码';

      const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
        setModalProps({ confirmLoading: false });
        //qrCodeUrl.value = await getQrCode(data.userId);
      });
      return {
        registerModal,
        closeModal,
        qrCodeUrl,
        getTitle,
      };
    },
  });
</script>

<style></style>
